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

Query time 0.00025