UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ASynuMv8aZ1wI9jjMxnGK9d765TYd0zyeEJVV/WM6qo='
WHERE
key_id = '7ee5c70a488113ca942007afd67c94b177290f146e0795df330fa637fad6a6b6'
AND (
token = 'ASynuMv8aZ1wI9jjMxnGK9d765TYd0zyeEJVV/WM6qo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)