UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CsP3Ukxaix2BnFfKGWTRKqCU6ImVo/jvAdoEQ2LQOGA=' 
WHERE 
  key_id = '83ced9fbc68dda9713e3e41f9a10e75eb2a6fa6e63e67819823bab948c4ac450' 
  AND (
    token = 'CsP3Ukxaix2BnFfKGWTRKqCU6ImVo/jvAdoEQ2LQOGA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017