UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gg5Lwpc4kkQ9LANUMWnGusDTvZ9u/T0YDP+w7WypXNc='
WHERE
key_id = '93ac0c1b26fab45c0600aa279b09416292d60275a3a22a153a7271197c5b8828'
AND (
token = 'gg5Lwpc4kkQ9LANUMWnGusDTvZ9u/T0YDP+w7WypXNc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)