UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Dr8WEwkqjqVGKwX5M4Y8y3qtLrzlP25E0bu9waZ/xAg=' 
WHERE 
  key_id = 'f3435ca210f3c8550ffac3e8e0a368d3baab1e12c720f9b8b6846533f1230ef3' 
  AND (
    token = 'Dr8WEwkqjqVGKwX5M4Y8y3qtLrzlP25E0bu9waZ/xAg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025