UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ptjBm24mLQwFEK3LNVowUjzaZ6vsPesbIAVKpwo4zeo='
WHERE
key_id = '1fa2142ef78373c50cc028f740e888f7611d185fa3052d5285397ef9fed3a8d3'
AND (
token = 'ptjBm24mLQwFEK3LNVowUjzaZ6vsPesbIAVKpwo4zeo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)