UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/YFJFJwqil50pgvBxcAQqNFjl2gJ1RYZfkuZuH5ebdM='
WHERE
key_id = '7723bca75124145b206297e9ac691959849dfd584550294b32ad6bee1f9cd9ba'
AND (
token = '/YFJFJwqil50pgvBxcAQqNFjl2gJ1RYZfkuZuH5ebdM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)