UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xWLqZtrwYpu0IpAru7MsyAhXYleRfD/3ei0W/NUEjqg=' 
WHERE 
  key_id = '3153a15d1153cec0758b3e261d2a320b99a58fd148e79807b99c8a5752c1da68' 
  AND (
    token = 'xWLqZtrwYpu0IpAru7MsyAhXYleRfD/3ei0W/NUEjqg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021