UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gEtVszoIzIuqxaQU49m1NYYHkQghuVO4KdbyTKIiVE4='
WHERE
key_id = '273c970c60877c9a987451646c06b58d9c88d74f4bb3f836190d271fb54efb75'
AND (
token = 'gEtVszoIzIuqxaQU49m1NYYHkQghuVO4KdbyTKIiVE4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)