UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4VbLCPdK7bUl9SYRsarSWZK2vxS1v8/x6n+o2fXRfSI='
WHERE
key_id = '82068c1867eb6e1dc6132ca3d9b28fa2cd99fb93ed0f522414bad4d7eddd488b'
AND (
token = '4VbLCPdK7bUl9SYRsarSWZK2vxS1v8/x6n+o2fXRfSI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)