UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JwruaRNJCpBxA7ejP1RK7V+9hDb9dmCh5DABLHJFQrY=' 
WHERE 
  key_id = 'be6b052ed47d7e98fe6ebfb7899a95778c58ddeba3faae34095ee337e94d6573' 
  AND (
    token = 'JwruaRNJCpBxA7ejP1RK7V+9hDb9dmCh5DABLHJFQrY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019