UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f/MqZWPjxDKWcz2VE0ZrbxjxntIJDgEEa9nIDBzI4uk='
WHERE
key_id = 'ae0408ed9dfbad73a8eb2aab8675a6283e481a959be5acb3d6a7338fac122fdd'
AND (
token = 'f/MqZWPjxDKWcz2VE0ZrbxjxntIJDgEEa9nIDBzI4uk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)