UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X8RYG4HNzmk+AF5krLSMWEaft3Rz4UbwuAtHuviUK0U=' 
WHERE 
  key_id = 'eba1b91bd802b75414dcc393e74d597587723cd8ce5ef3ada405ab53b3db15e9' 
  AND (
    token = 'X8RYG4HNzmk+AF5krLSMWEaft3Rz4UbwuAtHuviUK0U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034