UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cBbNRYUKdaInQVz7KSYZuFgkvH1CLVEJlL7ZPDK7pII=' 
WHERE 
  key_id = 'b1b19ae9fc5daf48aac80fb67d6bd19a2e0f6dd3a1680eb69e69afa74640589e' 
  AND (
    token = 'cBbNRYUKdaInQVz7KSYZuFgkvH1CLVEJlL7ZPDK7pII=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017