UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KoUkaO240tFuNUlGHvKBiP9afs7o3THmIRvoToo0/dI='
WHERE
key_id = '1d6bf03a687ffe592ab6eff3520ca21b5fb7892dd449981aa6cf10478f700982'
AND (
token = 'KoUkaO240tFuNUlGHvKBiP9afs7o3THmIRvoToo0/dI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)