UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OYKvseTyM4HZkF72A/G51v1sfQARUNWHwprWhMlqBEE=' 
WHERE 
  key_id = 'f6aad79a668beee1189c84181e2865fbbc072eb4666bd93e29057b0162ad0159' 
  AND (
    token = 'OYKvseTyM4HZkF72A/G51v1sfQARUNWHwprWhMlqBEE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020