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