UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ea3fghF0cqoduznPZhW9ON8m+bp6EvPnAASMfPR4HsA='
WHERE
key_id = '439eaa8b0a7697c66a7b4127d9124975584f5f6bb64811533c4661d422a02a5d'
AND (
token = 'ea3fghF0cqoduznPZhW9ON8m+bp6EvPnAASMfPR4HsA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)