UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UqMVejLqcisTmhjH3Xji/7nu4zYvI6FYOvRj/3Ma+ZI='
WHERE
key_id = '35589be0c26f8b2325eefe694a1194853281e7ecb6a27509662c80ec0635df2e'
AND (
token = 'UqMVejLqcisTmhjH3Xji/7nu4zYvI6FYOvRj/3Ma+ZI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)