UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vQmYv6mzTdLUHufI2zEPucG18+PXXIzR6Jx8yYG18fY='
WHERE
key_id = '0229eb55ea40197acffd82b7e4e30ab1cb84db13b85ca1e52a8c4ebb089623ac'
AND (
token = 'vQmYv6mzTdLUHufI2zEPucG18+PXXIzR6Jx8yYG18fY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)