UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JsXd5X6zAdPDr6e4l/slu6gDh9om7AwGEN5jW/hCYs0=' 
WHERE 
  key_id = 'b4ef1353020a7f7c0d9363f6118d884a795474f8b28e93dce92ac3138477192d' 
  AND (
    token = 'JsXd5X6zAdPDr6e4l/slu6gDh9om7AwGEN5jW/hCYs0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024