UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D25+IWYIeK1wI8YaYAKooQtokJc6PPqkJ5uMo4SmVdc='
WHERE
key_id = '2343623cf08c43eff653c70d66ce925baec4297ad1c17fc2962f13be6b1535d8'
AND (
token = 'D25+IWYIeK1wI8YaYAKooQtokJc6PPqkJ5uMo4SmVdc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)