UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LLE4euhnEz6mmpRZbq86crh4vjqKgmPF3KKDNe2dMrk='
WHERE
key_id = '943b18cc5dff80d3581b2345ddf16e32a71aacdb02e8f26b6d7cc6453c320c5a'
AND (
token = 'LLE4euhnEz6mmpRZbq86crh4vjqKgmPF3KKDNe2dMrk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)