UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H05FN/e/hW4UFAsg+NAwWJjBe/QpLVUe/2UVXDZvfKs=' 
WHERE 
  key_id = 'e5199633c92879b53c96d4e9e05bd9fe2057dc3eebe76d93e4a516a8ddbf8dd2' 
  AND (
    token = 'H05FN/e/hW4UFAsg+NAwWJjBe/QpLVUe/2UVXDZvfKs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022