UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zG4tQa7CLN3ClTbeAgnJnnAZ8PFRiaUuuEaxGlk4QS0=' 
WHERE 
  key_id = 'dd0287eef78005a019a64e81eba1d73d7cb7ed6ab982e08202a35942ba1ade63' 
  AND (
    token = 'zG4tQa7CLN3ClTbeAgnJnnAZ8PFRiaUuuEaxGlk4QS0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034