UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EqDzy3xc0yR5SKq0t6NunZJKuEgsxg3S6w7QhKOdQ2Q=' 
WHERE 
  key_id = 'cba35a52ee4029a33405f806bba75048301b418f8460e5b98f3c6b95f90f7076' 
  AND (
    token = 'EqDzy3xc0yR5SKq0t6NunZJKuEgsxg3S6w7QhKOdQ2Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028