UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DycAdJR4Uxct1J0bO44tWeKFCbbDuN4i31b++/nxU3k=' 
WHERE 
  key_id = '8df4bbad12988bc967f2d344ef198a82bd624c86c947d385a7a04a0cb10b0a0e' 
  AND (
    token = 'DycAdJR4Uxct1J0bO44tWeKFCbbDuN4i31b++/nxU3k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024