UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j6hPIRQgGzQ0LFtiospYkc0t+XGxdb7g29pq1lmKt/o='
WHERE
key_id = 'aac738d58675f9dd1d6bedb9fbd326728187e708cb73a08fc33b42052e66262d'
AND (
token = 'j6hPIRQgGzQ0LFtiospYkc0t+XGxdb7g29pq1lmKt/o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)