UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Dm19AhXjY784/K1jPPbOXBhet+V5da/7d+F1PTDb7kM='
WHERE
key_id = '13d4fc54d30fe11659f3efbb2fb17b23703d1a897447333b7b5601cdf426db9f'
AND (
token = 'Dm19AhXjY784/K1jPPbOXBhet+V5da/7d+F1PTDb7kM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)