UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vSyRCfmpJwPETYAZ4v+XEQ3sID0HdF6GUi443BP/ANs=' 
WHERE 
  key_id = 'f7cb4b3d71ea7f594bf7b5f513df3565dc3057063f16c5ed925254cf80eecf57' 
  AND (
    token = 'vSyRCfmpJwPETYAZ4v+XEQ3sID0HdF6GUi443BP/ANs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029