UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'axYXCCuQRT5AGHOlGntshlcp0mLOkTMEodM4ci5iafE='
WHERE
key_id = 'fc94c747620bc8e1c7d8781f3c09ef99a945053fe0e728998c1c1311eaec6010'
AND (
token = 'axYXCCuQRT5AGHOlGntshlcp0mLOkTMEodM4ci5iafE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)