UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0A6eW//9oUBANZv5ErbvMYIG4aKeI2CP4wPDrF2rsKs=' 
WHERE 
  key_id = 'fde758ae75a2b886fa76a4e9e5190e1bd24c944ee03d43e252394fc0a7414188' 
  AND (
    token = '0A6eW//9oUBANZv5ErbvMYIG4aKeI2CP4wPDrF2rsKs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034