UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v/NROPTi6iYuW/JwkFPXp/iHMGrrNNzJkKA9yQZOw74=' 
WHERE 
  key_id = '6072ff07f2d714691b88d19196b2fe4699f9cb9c3cb878a16f12a80b3af12667' 
  AND (
    token = 'v/NROPTi6iYuW/JwkFPXp/iHMGrrNNzJkKA9yQZOw74=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023