UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+L8RopGfoh8QaFsORM3ZfbxOMK9u9mB2SB+SGxMWoP0='
WHERE
key_id = '4324654a230c6bee4476f04bd4d243ab75d032836049e848a9bf1519e44d3fa5'
AND (
token = '+L8RopGfoh8QaFsORM3ZfbxOMK9u9mB2SB+SGxMWoP0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)