UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cAjbLUu02EZtK6kfDZAbO/3BPDUu0F4RNGcv+ROFSCE=' 
WHERE 
  key_id = '92dac024dc776815aedf6e32842e7954d83b5cee787c9980cf56034835910f5f' 
  AND (
    token = 'cAjbLUu02EZtK6kfDZAbO/3BPDUu0F4RNGcv+ROFSCE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015