UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SwUIoMoCJvkPJd+PBpr5TmyivmYuXPdehQpNEGhBHTY='
WHERE
key_id = 'c0f8daae1be0974ebb4ace07935836c33fe4a48774630abe0e335458c3fd23e9'
AND (
token = 'SwUIoMoCJvkPJd+PBpr5TmyivmYuXPdehQpNEGhBHTY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)