UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uys/HpOrMrjsHuKnwZg7RxmCxWBAIkZZOFM8iaoCcpI='
WHERE
key_id = '9f12a82e33f78a7657af54649e8eac010879eb4fe7514130a4283775b423c3d7'
AND (
token = 'uys/HpOrMrjsHuKnwZg7RxmCxWBAIkZZOFM8iaoCcpI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)