UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BoGnSNdI7Cd/x96ubqJ54JZ0YuXClV/QLxFHb4wv+c4=' 
WHERE 
  key_id = 'dff990cab41c13ef9e6a5a68b786fab7938336aad0e0348ef5a4e91b1943cf63' 
  AND (
    token = 'BoGnSNdI7Cd/x96ubqJ54JZ0YuXClV/QLxFHb4wv+c4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030