UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1jzB9mdUYYdxWSzUilzzkvUiJkCsfsee6xqdwJDIjzU='
WHERE
key_id = 'f492e7e408764b6b8d1a9d04fdda5031acdd9a0dd6269f1db2665eca3f44f3e7'
AND (
token = '1jzB9mdUYYdxWSzUilzzkvUiJkCsfsee6xqdwJDIjzU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)