UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cTiMPKjkfXKGRTA2FGGtp44wDTutLSqfSiDWOexdxk0='
WHERE
key_id = '19516cda60c96298247a503c313d27d2e437722a55718fd160cf396984e2d6b8'
AND (
token = 'cTiMPKjkfXKGRTA2FGGtp44wDTutLSqfSiDWOexdxk0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)