UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ETOtNfdzqDsd+Nr8sDpP5N8K1SrT5syGoxv+dTKXWWg='
WHERE
key_id = 'd80674f8f40d4060728004c7d35dd91a8ac797ae21e48c13c47bd3bc2067ed12'
AND (
token = 'ETOtNfdzqDsd+Nr8sDpP5N8K1SrT5syGoxv+dTKXWWg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)