UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5SULe8i0QVjueGz4ev+kS+DZLQGHi2O+gh0FEDVsAMk='
WHERE
key_id = '77dfe76720a878dbf82be120e4dd5c32ac931e95c04c3b7802996bccac9085a2'
AND (
token = '5SULe8i0QVjueGz4ev+kS+DZLQGHi2O+gh0FEDVsAMk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)