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