UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pDCa9JOhhkBYux/jaM9eTZNkMmh+z965/m59Iu/dPkc=' 
WHERE 
  key_id = 'b194cc4c5f8486710181076bbd43ead8a3b49240bac458710007b19d5291b86d' 
  AND (
    token = 'pDCa9JOhhkBYux/jaM9eTZNkMmh+z965/m59Iu/dPkc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022