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