UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R35DFbmMTZyOfAV7oTMaIkxFLRhciT7DcI3U6SKaRbM='
WHERE
key_id = '2395f8663765b4fa875931c4a18052eb060e3f08ed641bb3dbc90ba786faa525'
AND (
token = 'R35DFbmMTZyOfAV7oTMaIkxFLRhciT7DcI3U6SKaRbM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)