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