UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dwyu79ky2nn1Gasm+50g/ZYW6KnAIQvTTHYXLDrzmQk=' 
WHERE 
  key_id = '32628c4620aebd573ae31ab604dedd6a70c5174fbff9ee94bba94dfd8d1c50fe' 
  AND (
    token = 'dwyu79ky2nn1Gasm+50g/ZYW6KnAIQvTTHYXLDrzmQk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027