UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7IWgYYHjX6pbsAxnQeAbs3heharn9ce5+x4yrx6I8qs='
WHERE
key_id = '98a082b94a17154069df252126e5856ac02e4a7039205a8ccf0b2dbd6f38bfe1'
AND (
token = '7IWgYYHjX6pbsAxnQeAbs3heharn9ce5+x4yrx6I8qs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)