UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mjmZE4vnSkI0pFVm5ftDtvrwnhFpqqcJ110n6gmvHes='
WHERE
key_id = '149b29ab6c521477ceca92ef396a00078797f45c9cbf160fe097263804330f5b'
AND (
token = 'mjmZE4vnSkI0pFVm5ftDtvrwnhFpqqcJ110n6gmvHes='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)