UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LbzUdMe3v9E3qwnxdFVu/WooozYXYLhRWUaU9xnTd3s='
WHERE
key_id = '646acf364264dbca569d48eb42286403e83ebd31b40985b8bdfbc14b97671ab9'
AND (
token = 'LbzUdMe3v9E3qwnxdFVu/WooozYXYLhRWUaU9xnTd3s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)