UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mkrMM9/QRhlgEcKB0xW+oxVLjUYfXrP3qGMBHleFWWw='
WHERE
key_id = '5933a3119e81549ea98fcabf854ff729a0e387aa748bb1644a20e23f7eb0ce3d'
AND (
token = 'mkrMM9/QRhlgEcKB0xW+oxVLjUYfXrP3qGMBHleFWWw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)