UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zfrQ54pRDkIXqd3qvAqni/xaSiK1iCjgz4vIzSgeFjY=' 
WHERE 
  key_id = 'bc978ae9e784716a36e19be12dbdf68ba5ba6f8fbea7c5ae14f3f9758e5a4cf2' 
  AND (
    token = 'zfrQ54pRDkIXqd3qvAqni/xaSiK1iCjgz4vIzSgeFjY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032