UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jVGs4pHFu2yn68pqYe3l4KZMHTMXkMMubG0Vv4F/KDw='
WHERE
key_id = '46ad62d8e677c73962157a04faf88f40ecabddfcaeebad8017d2845ee81d51fe'
AND (
token = 'jVGs4pHFu2yn68pqYe3l4KZMHTMXkMMubG0Vv4F/KDw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)