UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ka1DRBya9wl4EZ968vXFtl5q7y88g4W+jZvlXmmfcXs='
WHERE
key_id = '05e9327a56254cebd3e7b3587231639fcd819bf93ad4395b11262fe5b890311a'
AND (
token = 'Ka1DRBya9wl4EZ968vXFtl5q7y88g4W+jZvlXmmfcXs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)