UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tCDv8zoFnSXJ4209rb3fRa73K1P+dxACJBG7Kxu6hZM='
WHERE
key_id = '957097ac70d678eab482942aafaccbd7e4c2026749a67a9638b2e99a68fccd3a'
AND (
token = 'tCDv8zoFnSXJ4209rb3fRa73K1P+dxACJBG7Kxu6hZM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)