UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CBpsv++ce2CfvXMsCxjrf42YJB7FzJ3terkLBB6G0Ag='
WHERE
key_id = 'c27f5ac4dc9f056a18e441a9902cba025633afa96181eb7ecd589f96927c0d51'
AND (
token = 'CBpsv++ce2CfvXMsCxjrf42YJB7FzJ3terkLBB6G0Ag='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)