UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mvl9IW0F0IMTk3FCbZ7HpPfsNmb85TQkuxD6AE5E6xw=' 
WHERE 
  key_id = '33273797d42c5930b2f459f5ed8c90aca75f6a06f2a442e1f812c2c17f8151e1' 
  AND (
    token = 'Mvl9IW0F0IMTk3FCbZ7HpPfsNmb85TQkuxD6AE5E6xw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021